package com.example.chuzhou.config;

import com.lx.saas.common.MqConfig;
import com.lx.saas.core.Sender;
import org.springframework.context.annotation.Bean;

//@Configuration
public class KafkaConfig {

    @Bean("sender")
    public Sender getSender() throws Exception {
        MqConfig mqConfig = new MqConfig.Builder()
                .bootstrapServers("10.150.148.95:9092,10.150.148.127:9092,10.150.148.130:9092")
//                .bootstrapServers("59.203.54.210:9092,59.203.54.210:9093,59.203.54.210:9094")
                .topicName("saas_log_topic")
                .build();//构建mq配置

        Sender sender = new Sender();
        sender.initConnect(mqConfig);
        return sender;
    }
}
